package com.health.schedule;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.SocketTimeoutException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.TimeUnit;

import javax.servlet.ServletContext;

import org.apache.commons.codec.binary.Base64;
import org.apache.log4j.Logger;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.DeserializationConfig;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
 

import org.springframework.context.ApplicationContext;

import com.health.commons.PropertiesService;
 
import com.health.db.model.IMsgIMMessage;
import com.health.db.model.IMsgIMMessageExt;
import com.health.db.model.RegisterOrder;
import com.health.db.model.RegisterOrderExample;
 
import com.health.db.service.msg.IIMsgIMMessageService;
import com.health.db.service.order.IRegisterOrderService;
import com.health.mapp.bean.rongcloud.RongCloudCallBackReq;
 
import com.health.mapp.bean.rongcloud.RongCloudHelper;
import com.health.mapp.service.SpringContextUtil;
import com.health.mapp.utils.Constant;
import com.health.mapp.utils.DateUtils;
import com.health.mapp.utils.GetRemoteFileHTTPClient;
import com.health.mapp.utils.MappGlobal;
import com.health.mapp.utils.PropertiesUtil;
import com.health.mapp.utils.RongCloudMessageUtil;
import com.health.mapp.utils.UploadByOss;
import com.health.redis.RedisClient;
 
//you can test image when this is no redis 
// result= "{\"appId\":\"c9kqb3rdkbb5j\",\"fromUserId\":\"493557\",\"targetId\":\"27816\",\"targetType\":3,\"GroupId\":\"27816\",\"classname\":\"RC:ImgMsg\",\"content\":{\"content\":\"\\/9j\\/4AAQSkZJRgABAQAASABIAAD\\/4QBYRXhpZgAATU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQAAAABAAAAJgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAA8KADAAQAAAABAAAAtAAAAAD\\/7QA4UGhvdG9zaG9wIDMu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vyV96ji+8Ks96kpEXkr70nkp71NSUDGLAme9V7qFDJ3q6vWq91\\/rKljRn+QnvVwQIEGM1F3q3\\/AAipZojNaFSc5NN8hPU1O1JQJkYgT1NWYUwduTimVPF94UEy2LIiXPepxEvvTB1qeqMRvlr71UuIU296vVXuPu0wP\\/\\/Z\",\"user\":{\"name\":\"杨保青\",\"icon\":\"http:\\/\\/shouer.oss-cn-beijing.aliyuncs.com\\/user\\/userdefault.png\",\"id\":\"493557\"},\"imageUri\":\"https:\\/\\/rongcloud-image.cn.ronghub.com\\/image_jpeg__RC-2017-04-26_5242_1493180911072?e=2147483647&token=CddrKW5AbOMQaDRwc3ReDNvo3-sL_SO1fSUBKV3H:Whdk_q9b2LOeSF_wrKvSFVieXlU=\"},\"dateTime\":\"2017-04-26 12:28:31.977\",\"msgUID\":\"5DQH-14HD-4C1D-KRVO\",\"source\":\"iOS\"}";
//you can test voice when this is no redis 
//result="{\"appId\":\"c9kqb3rdkbb5j\",\"fromUserId\":\"67\",\"targetId\":\"27819\",\"targetType\":3,\"GroupId\":\"27819\",\"classname\":\"RC:VcMsg\",\"content\":{\"content\":\"IyFBTVIKLNEafAAeef\\/hgmeAH8AD\\/+ggggAALMWpzAAf+f\\/hgmYAH8AD\\/+ggggAALEdBQCI\\/sXXDPsRCH4RGv+gghoACLIMNjhagD165K3R5UrfP4eKn1US2LGlFjh8FFNSm0xaWWhvDQYrMLksELINmjh6Bl+S2SgL4Enj4LxgWtx9ULJCjjh+In11jg4duEmkbJkV0P+OWLE6YvB9wDzEIO0txoR8sb29ZDWsQLE9+kB6AGwy1RinqgAlD+ZcixH+iLIqYjh8gHMmpQ8\\/WVo4pThfbC7mGLGijHB8EVSTu0YYDpPTPnvySk54QLJCwkB6Ag9\\/XtnV0NVbSFI87QQOALE0GwB5GH8p+BHWgafIV+O\\/vlj7ELE9Fjh4ga7t4wuSSULcl6YRrqcq6LISYjh4BFF4eUvietz0G8MkkS1e+LJCwsh8BnzpPZKYS5d\\/nfg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3lAa4LJF+zFiiO+6Hgiu8+h6ZOeKXvCi2LEKLRhtAHagvlmco1dTiuok746BMLFMrsh7IS+thCueolycPphNyUP8SLEgOtB5jHRH6Zl6yTxZfHxX1i0OeLEyWQA8BHczWh93nXC+QsggNpJxoLEV\\/\\/B4gGxTVtzXgopdYnxR3skImLEOx\\/h4AS+22kkT90Tjt7XILYE\\/GLEUqnB4AH6Ya32rkXfgNpsojcavQLE2UjhaBtfRaYsa9XtaxsFnoOJ4KLEaLdBwjVc8bdeqPhRp3rQVi8gn8LExvQB6AKrrQ58UJYEc1Ho9YVUfc\",\"duration\":10,\"user\":{\"name\":\"值班医师6\",\"icon\":\"http:\\/\\/shouer.oss-cn-beijing.aliyuncs.com\\/docImage\\/kefu.png\",\"id\":\"67\"}},\"dateTime\":\"2017-04-26 12:49:16.946\",\"msgUID\":\"5DQH-5SGI-8C1D-KRVR\",\"source\":\"iOS\"}";
/***
 * 
 * @author acer
 *
 */
public class OrderTimeoutController {
	private static Logger logger = Logger.getLogger(OrderTimeoutController.class);
	private MyTestThread myTestThread1;
	private MyTestThread2 myTestThread2;
	private MyTestThread3 myTestThread3;
	private MyTestThread7 myTestThread7;
	private MyTestThread4 myTestThread4;
	private MyTestThreadRongCloudCallback myTestThreadRongCloudCallback;

	private MyTestThreadRCUpload2OSS myTestThreadRCUpload2OSS;
	/**
	 * 
	 */
	public void initialize() {

		// 启动线程

		/*
		myTestThread1 = new MyTestThread();
		new Thread(myTestThread1).start();

		myTestThread2 = new MyTestThread2();
		new Thread(myTestThread2).start();

		myTestThread3 = new MyTestThread3();
		new Thread(myTestThread3).start();

		myTestThread4 = new MyTestThread4();
		new Thread(myTestThread4).start();
		/*
		/*
		 * myTestThread7 = new MyTestThread7(); new
		 * Thread(myTestThread7).start();
		 * 
		 * */
		/*
		 myTestThreadRongCloudCallback= new MyTestThreadRongCloudCallback();
		  new Thread(myTestThreadRongCloudCallback).start();
		  
		  myTestThreadRCUpload2OSS= new MyTestThreadRCUpload2OSS();
		  new Thread(myTestThreadRCUpload2OSS).start(); 
*/
	}

	class MyTestThread implements Runnable {
		// 频率
		private int frequency = Integer.valueOf(PropertiesUtil.getString("OrderTimeout_frequency").trim());

	 

		public void run() {
			while (true) {
				String timeDefine = PropertiesUtil.getString("Order_RunStatus1_Timeout");

				// System.out.println("线程"+Thread.currentThread().getName()+" "+frequency+"分钟后复活......");
				IRegisterOrderService registerOrderService = SpringContextUtil.getBean("registerOrderService");
				// System.out.println("registerOrderService:"+registerOrderService);
				// System.out.println("timeDefine:"+timeDefine);

				List<RegisterOrder> registerOrderTempList = null;
				RegisterOrderExample queryCond = new RegisterOrderExample();

				// queryCond.setCreateDate(DateUtils.yesterdayDate());
				queryCond.setRunstatusid(1);

				registerOrderTempList = registerOrderService.selectOrderState4Timeout(queryCond);
				// System.out.println("need modify:"+registerOrderTempList.size());

				if (null != registerOrderTempList
						&& registerOrderTempList.size() > 0) {
					// 买家24小时内未付款，自动关闭
					registerOrderService.processRunStatus1OrderTimeout(registerOrderTempList, timeDefine);
				}

				try {
					TimeUnit.MINUTES.sleep(1 * frequency);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					 logger.warn(e.getCause());
				}
			}

		}
	}

	/**
	 * 已付款->已结束
	 * 
	 * @author HiRoad
	 * 
	 */
	class MyTestThread2 implements Runnable {
		// 频率
		private int frequency = Integer.valueOf(PropertiesUtil.getString(
				"OrderTimeout_frequency").trim());

		// 间隔
		private long timeGap = 30;

		public void run() {

			while (true) {

				String timeDefine = PropertiesUtil.getString("Order_RunStatus2_Timeout");

				// System.out.println("线程"+Thread.currentThread().getName()+" "+frequency+"分钟后复活......");

				IRegisterOrderService registerOrderService = SpringContextUtil.getBean("registerOrderService");

				// System.out.println("registerOrderService:"+registerOrderService);
				List<RegisterOrder> registerOrderTempList = null;
				RegisterOrderExample queryCond = new RegisterOrderExample();

				queryCond.setRunstatusid(2);
				registerOrderTempList = registerOrderService.selectOrderState4Timeout(queryCond);

				if (null != registerOrderTempList&& registerOrderTempList.size() > 0) {
					// 卖家24小时内未发货，自动退款并关闭
					registerOrderService.processRunStatus2OrderTimeout(registerOrderTempList, timeDefine);
				}

				try {
					TimeUnit.MINUTES.sleep(1 * frequency);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					 logger.warn(e.getCause());
				}

			}// end while

		}
	}

	/**
	 * 已就诊->待评价
	 * 
	 * @author HiRoad
	 * 
	 */
	class MyTestThread3 implements Runnable {
		// 频率
		private int frequency = Integer.valueOf(PropertiesUtil.getString("OrderTimeout_frequency").trim());

		// 间隔
		private long timeGap = 30;

		public void run() {
			String timeDefine = PropertiesUtil
					.getString("Order_RunStatus3_Timeout");
			int count = 0;
			while (true) {

				// System.out.println("线程"+Thread.currentThread().getName()+" "+frequency+"分钟后复活......");
				IRegisterOrderService registerOrderService = SpringContextUtil.getBean("registerOrderService");
				// System.out.println("registerOrderService:"+registerOrderService);
				List<RegisterOrder> registerOrderTempList = null;
				RegisterOrderExample queryCond = new RegisterOrderExample();
				// queryCond.setCreateDate(DateUtils.yesterdayDate());
				queryCond.setRunstatusid(3);
				registerOrderTempList = registerOrderService.selectOrderState4Timeout(queryCond);
				// System.out.println("need modify:"+registerOrderTempList.size());
				if (null != registerOrderTempList
						&& registerOrderTempList.size() > 0) {
					// 买家24小时内未确认收货，自动打款并转完成
					registerOrderService.processRunStatus3OrderTimeout(registerOrderTempList, timeDefine);
				} else {
				}

				try {
					TimeUnit.MINUTES.sleep(1 * frequency);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					 logger.warn(e.getCause());
				}

			}// end while
		}
	}

	/**
	 * 待评价->已完成
	 * 
	 * @author HiRoad
	 * 
	 */
	class MyTestThread4 implements Runnable {
		// 频率
		private int frequency = Integer.valueOf(PropertiesUtil.getString(
				"OrderTimeout_frequency").trim());

		// 间隔
		private long timeGap = 30;

		public void run() {
			String timeDefine = PropertiesUtil
					.getString("Order_RunStatus4_Timeout");
			int count = 0;
			while (true) {

				// System.out.println("线程"+Thread.currentThread().getName()+" "+frequency+"分钟后复活......");
				IRegisterOrderService registerOrderService = SpringContextUtil.getBean("registerOrderService");
				// System.out.println("registerOrderService:"+registerOrderService);
				List<RegisterOrder> registerOrderTempList = null;
				RegisterOrderExample queryCond = new RegisterOrderExample();
				// queryCond.setCreateDate(DateUtils.yesterdayDate());
				queryCond.setRunstatusid(4);
				registerOrderTempList = registerOrderService.selectOrderState4Timeout(queryCond);
				// System.out.println("need modify:"+registerOrderTempList.size());
				if (null != registerOrderTempList
						&& registerOrderTempList.size() > 0) {
					// 买家24小时内未确认收货，自动打款并转完成
					registerOrderService.processRunStatus4OrderTimeout(registerOrderTempList, timeDefine);
				}

				try {
					TimeUnit.MINUTES.sleep(1 * frequency);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					 logger.warn(e.getCause());
				}

			}// end while
		}
	}

	class MyTestThread7 implements Runnable {
		// 频率
		private int frequency = Integer.valueOf(PropertiesUtil
				.getString("OrderTimeout_frequency"));

		// 间隔
		private long timeGap = 30;

		public void run() {
			String timeDefine = PropertiesUtil
					.getString("Order_RunStatus7_Timeout");
			int count = 0;
			while (true) {

				IRegisterOrderService registerOrderService = SpringContextUtil.getBean("registerOrderService");
				List<RegisterOrder> registerOrderTempList = null;
				RegisterOrderExample queryCond = new RegisterOrderExample();

				queryCond.setRunstatusid(7);
				registerOrderTempList = registerOrderService.selectOrderState4Timeout(queryCond);

				if (null != registerOrderTempList
						&& registerOrderTempList.size() > 0) {
					// 卖家24小时内未确认退款，自动退款并转关闭
					registerOrderService.processRunStatus7OrderTimeout(registerOrderTempList, timeDefine);
				} else {
				}

				try {
					TimeUnit.MINUTES.sleep(1 * frequency);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					 logger.warn(e.getCause());
				}

			}// end while
		}
	}

	class MyTestThreadRongCloudCallback implements Runnable {
		// 频率
		private int frequency = 1;

	 

		public void run()  {
			
			String timeDefine = PropertiesUtil.getString("IMsgIMMessageGetFromRedisInterval");
			List<IMsgIMMessage> messageList = new ArrayList<IMsgIMMessage>();
			List<IMsgIMMessage> removeMessageList = new ArrayList<IMsgIMMessage>();
			 while (true) {

				try {
				 

				//RedisOperatiorLogic redisOperatiorLogic = (RedisOperatiorLogic) SpringContextUtil.getBean("redisOperatiorLogic");
				IIMsgIMMessageService iMsgIMMessageService =(IIMsgIMMessageService) SpringContextUtil.getBean("iMsgIMMessageService");
				 
	
				////先进先出队列
				String key = "queen_imsg_im_message";
				String result = null;
				 

				 result = (String) RedisClient.rpopDataOutRedis(key);
			    	//you can test image when this is no redis 
					   //result= "{\"appId\":\"c9kqb3rdkbb5j\",\"fromUserId\":\"493557\",\"targetId\":\"27816\",\"targetType\":3,\"GroupId\":\"27816\",\"classname\":\"RC:ImgMsg\",\"content\":{\"content\":\"\\/9j\\/4AAQSkZJRgABAQAASABIAAD\\/4QBYRXhpZgAATU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQAAAABAAAAJgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAA8KADAAQAAAABAAAAtAAAAAD\\/7QA4UGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAAA4QklNBCUAAAAAABDUHYzZjwCyBOmACZjs+EJ+\\/8AAEQgAtADwAwEiAAIRAQMRAf\\/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC\\/\\/EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29\\/j5+v\\/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC\\/\\/EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIj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RTeTRcDa\\/t2+\\/2fyqp\\/aUx6qv61QOBTSadxptbFma4acgsAMDAxUNMHAyaTzMdKm4FtBniqrDaxBp8c+0\\/MOKdKUchkPWs57A0NQVajTc2KhReKuQDGTWUdyWMaPFR7asPyaFXJrUkrEU0gVoeWp7VE0HpRYD\\/0eGB5p6PsNQ5xQvPFIC6ZMijzieGqpkjilzQBOx7ioCxpCxpuaYDs0ZptSRgMeaYhRRmptgoCrSuBFUsT7XBowPSk4oGawbAp6cmqUT7lweoqwr44qGUjRcxonPU1SxiqyeY8xaTt0q+q9zQMj2+tBFS4ppFAEBFAUY3HoKl25pLgbFCUmwSKjNk02lxUsce75j0qblpDFQmpkjGetI5xwKjDEGkOxeCECrca4jqhFOOjVo5BTjpSS1M5x6ogPWpUIHWmYqcKCKqxmPBHamyNtXNMKMvK1BLJlCD1pgf\\/9LjPs6eppyW6bupqWnJ96kIha3TPU0n2dPU1YbrSUDIfs6eppPs6epqxSUxEIt09TU8VunqaBU8VMBPIT1NJ9nQetWKbSAh8hPU0nkJnqanpO9ADEhUMME1c8hPeoV6irnekxoSKBMjrVvyV96ji+8Ks96kpEXkr70nkp71NSUDGLAme9V7qFDJ3q6vWq91\\/rKljRn+QnvVwQIEGM1F3q3\\/AAipZojNaFSc5NN8hPU1O1JQJkYgT1NWYUwduTimVPF94UEy2LIiXPepxEvvTB1qeqMRvlr71UuIU296vVXuPu0wP\\/\\/Z\",\"user\":{\"name\":\"杨保青\",\"icon\":\"http:\\/\\/shouer.oss-cn-beijing.aliyuncs.com\\/user\\/userdefault.png\",\"id\":\"493557\"},\"imageUri\":\"https:\\/\\/rongcloud-image.cn.ronghub.com\\/image_jpeg__RC-2017-04-26_5242_1493180911072?e=2147483647&token=CddrKW5AbOMQaDRwc3ReDNvo3-sL_SO1fSUBKV3H:Whdk_q9b2LOeSF_wrKvSFVieXlU=\"},\"dateTime\":\"2017-04-26 12:28:31.977\",\"msgUID\":\"5DQH-14HD-4C1D-KRVO\",\"source\":\"iOS\"}";
					//you can test voice when this is no redis 
				// result="channelType=GROUP&fromUserId=69&toUserId=28326&msgTimestamp=1494407751008&timestamp=1494407751008&objectName=RC:TxtMsg&content={\"content\":\"我的人都有一个人\",\"user\":{\"name\":\"首儿健康\",\"icon\":\"http://shouer.oss-cn-beijing.aliyuncs.com/docImage/kefu.png\",\"id\":\"69\"}}&msgUID=5DV3-955C-0C1D-LKDH";
				 
				 // System.out.println("result:"+result);
						 
				if(null!=result && !"".equals(result))
				{  
					    logger.debug(key+" get 1 record.");
						 
						 
						IMsgIMMessage message= RongCloudHelper.parseObject(result);
						
						 
						
						if(messageList.size()==100)
						{
							iMsgIMMessageService.insertBatch(messageList);
							messageList.removeAll(removeMessageList);
							removeMessageList= new ArrayList<IMsgIMMessage>();
							 Iterator<IMsgIMMessage> it = messageList.iterator();   //创建迭代器
							  while (it.hasNext()) {       //循环遍历迭代器
								  logger.debug(it.next());    //输出集合中元素
							  }
							 
						}
						else
						{

							messageList.add(message);
							removeMessageList.add(message);
						}
					  
						
						
					}
					else 
					{
						//logger.debug(key+" get 0 record.");
						 if(messageList.size()>0)
						 {
							 iMsgIMMessageService.insertBatch(messageList);
							 
							 messageList.removeAll(messageList);
							 removeMessageList= new ArrayList<IMsgIMMessage>();
							 Iterator<IMsgIMMessage> it = messageList.iterator();   //创建迭代器
							  while (it.hasNext()) {       //循环遍历迭代器
								  logger.debug(it.next());    //输出集合中元素
							  }
						 }
						 
						 
					}
					

				 
				
					TimeUnit.MILLISECONDS.sleep(Long.valueOf(timeDefine) * frequency);
				} catch (InterruptedException e) {
					e.printStackTrace();
					// TODO Auto-generated catch block
					 logger.warn(e.getCause());
				 
			  
			   }
			    catch (Exception e) {
				// TODO Auto-generated catch block
			    	e.printStackTrace();
			    	 logger.warn(e.getCause());
			   }
			 }// end while
		}
	}
	class MyTestThreadRCUpload2OSS implements Runnable {
		// 频率
		private int frequency = 1;
 

		public void run() {
			
			String timeDefine = PropertiesUtil.getString("IMsgIMMessageUpload2OSSInterval");
			
		 
			 while (true) {

				try {
				 

				 
				IIMsgIMMessageService iMsgIMMessageService =(IIMsgIMMessageService) SpringContextUtil.getBean("iMsgIMMessageService");
 	
			 
			 
				IMsgIMMessageExt query= new IMsgIMMessageExt();
				query.setIsDeleteFlag(Constant.CONSTANTS_RONGCLOUDCALLBACK_MSG_PARSE_STATE_0);
				List<IMsgIMMessage> messageList=iMsgIMMessageService.selectByCondition(query);
				
				    
				if(null!=messageList && messageList.size()>0)
				{   
					logger.debug("Need upload to OSS data:  "+messageList.size()+" record.");
					iMsgIMMessageService.updateOSSInfo2TempState(messageList);
					  
				 	iMsgIMMessageService.updateOSSInfoByPrimaryKey(messageList);
						
				}
				else 
				{
						//logger.debug(key+" get 0 record.");
				}
					

				 
				
					TimeUnit.MILLISECONDS.sleep(Long.valueOf(timeDefine) * frequency);
			 
				 
			   } catch (Exception e) {
				// TODO Auto-generated catch block
				   logger.warn(e.getCause());
			   }
			 }// end while
		}
	}
	 


}
